package com.zhou.controller;

import com.alibaba.fastjson.JSONObject;
import com.zhou.dto.Parameter;
import com.zhou.dto.Result;
import com.zhou.entity.Department;
import com.zhou.service.DepartmentService;
import com.zhou.service.OtherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("other")
public class OtherController {

    @Autowired
    private OtherService otherService;
    @Autowired
    private DepartmentService departmentService;


    /**
     * 查询消息接收人基础信息
     */
    @RequestMapping("receiverBase")
    public Result ReceiverBase(){

        List<Department> departments = departmentService.findAll();
//        Department department = new Department();
//        department.setId(1);
//        department.setDepartment_name("所有院系部门");
//        departments.add(0,department);

        HashMap<String, Object> map = new HashMap<>();
        map.put("post",otherService.findAllPost());
        map.put("department",departments);
        map.put("professionalTitle",otherService.findAllProfessionalTitle());
        return Result.SUCCESS.setNewData(map);
    }


}
